<template>
    <view class="fixed-bottom">
        <view class="b-delete b-del-c" v-if="limitDel" @click="optionAct(0)"
            >删除</view
        >
        <view class="b-copy" v-if="limitSale" @click="optionAct(1)">开单</view>
        <view class="b-copy" @click="optionAct(3)">预付款</view>
        <view class="b-copyreader" @click="optionAct(2)">编辑</view>
    </view>
</template>

<script>
import accessCtrl from "../../js/limit/AccessCtrl.js";
export default {
    props: ["isOld"],
    data() {
        return {
            limitDel: false,
            limitSale: false,
        };
    },

    async created() {
        this.limitDel = accessCtrl.getPurchDelSupplyLimit;
        this.limitSale = accessCtrl.getPurchWriteBillLimit();
    },

    methods: {
        optionAct(act) {
            this.$emit("optionAct", act);
        },
    },
};
</script>

<style lang="scss">
.fixed-bottom {
    height: 60px;
    right: 0;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #ececec;
    border-bottom: 1px solid #ececec;
    overflow-x: auto;
    z-index: 99;
    font-size: 16px;
    display: flex;
    justify-content: flex-end;
    .b-copyreader {
        cursor: pointer;
        width: 200px;
        height: 60px;
        background: #3388ff;
        color: #fff;
        text-align: center;
        line-height: 60px;
    }
    // .b-copyreader:hover,
    // .b-delete:hover,
    // .b-copy:hover,
    // {
    // 	background: #F8F8F8 ;
    // 	color: #3388FF;
    // }
    .b-delete,
    .b-copy {
        cursor: pointer;
        width: 100px;
        height: 60px;
        text-align: center;
        line-height: 60px;
    }
    .b-del-c {
        color: red;
    }
    .b-delete:hover,
    .b-copy:hover {
        background-color: #eee;
    }
}
</style>
